<?php
/**
 * 
 * Modelo de SC_DetalleSend
 * @author natanael
 * 
 */
class MDetalleSend extends Model
{
     private $_nameTable = "SC_DetalleSend";
     
     public function __construct()
     {
         parent::Model();
         $this->load->database();
     }
     
     public function loadRegistro($idHeaders)
     {
     
				  
		 $result = $this->db->get_where($this->_nameTable, array("Id_Seguimiento" => $idHeaders));
	
	     return $this->GetArrayFromQueryResult($result);
			
     }
     
     private function GetArrayFromQueryResult($result) 
	 {
		 if ($result->num_rows() == 0)
				return false;
	
		 $estatus_arr = array();
	
		 foreach ($result->result() as $record) {
				$estatus_arr[] = new SC_DetalleSend($record);
		 }
	
		 return $estatus_arr;
     }
     
     public function addReguistro($data)
     {
          if ($this->db->insert($this->_nameTable,$data)) {
           	   return true;
           }
           
            return false;
     }
}

class SC_DetalleSend
{
	 private $_idEtapa = 0;
     private $_referencia = "";
     private $_contacto = "";
     private $_telefono = "";
     private $_idSeguimiento = 0;
  
     public function __construct($obt)
     {
     	 $this->setIdEtapa($obt->Id_Etapa);
     	 $this->setReferencia($obt->Referencia);
         $this->setContacto($obt->Contacto);
         $this->setTelefono($obt->telefono);
         $this->setIdSeguimiento($obt->Id_Seguimiento);
     }
     
     public function getIdEtapa()
     {
         return $this->_idEtapa;
     }
     
     public function setIdEtapa($value)
     {
         $this->_idEtapa = $value;
     }
     
     public function getReferencia()
     {
         return $this->_referencia;
     }
     
     public function setReferencia($value)
     {
         $this->_referencia = $value;
     }
     
     public function getContacto()
     {
         return $this->_contacto;
     }
     
     public function setContacto($value)
     {
         $this->_contacto = $value;
     }
     
     public function getTelefono()
     {
         return $this->_telefono;
     }
     
     public function setTelefono($value)
     {
         $this->_telefono = $value;
     }
     
     public function getIdSeguimiento()
     {
         return $this->_idSeguimiento;
     }
     
     public function setIdSeguimiento($value)
     {
         $this->_idSeguimiento = $value;
     }
    
}